home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / network / samba / patches / samba-1.025 / samba-1
Encoding:
Text File  |  1995-09-21  |  12.2 KB  |  419 lines

  1. diff -u -r --new-file last-version/docs/README.jis samba-1.9.14alpha20/docs/README.jis
  2. --- last-version/docs/README.jis    Fri Sep 15 20:17:28 1995
  3. +++ samba-1.9.14alpha20/docs/README.jis    Thu Sep 21 20:47:16 1995
  4. @@ -112,7 +112,7 @@
  5.  
  6.  5. $B$=$NB>(B
  7.  
  8. -  hex $B7A<0$NJQ495Z$S(BUNIX $B>e$G$N%U%!%$%kL>$NJQ49J}K!$O!"(B
  9. +  hex $B7A<0$NJQ49J}K!$O!"(B
  10.  
  11.      $BBgLZ!wBgDM!&C^GH(B <ohki@gssm.otsuka.tsukuba.ac.jp>$B;a(B
  12.  
  13. diff -u -r --new-file last-version/source/Makefile samba-1.9.14alpha20/source/Makefile
  14. --- last-version/source/Makefile    Fri Sep 15 20:20:29 1995
  15. +++ samba-1.9.14alpha20/source/Makefile    Thu Sep 21 20:24:34 1995
  16. @@ -162,7 +162,7 @@
  17.  
  18.  # This is for SUNOS5 (also known as Solaris 2)
  19.  # contributed by Andrew.Tridgell@anu.edu.au
  20. -# FLAGSM = -DSUNOS5 -DSHADOW_PWD -DNETGROUP -DBSD_COMP
  21. +# FLAGSM = -DSUNOS5 -DSHADOW_PWD -DNETGROUP 
  22.  # LIBSM = -lsocket -lnsl
  23.  
  24.  
  25. diff -u -r --new-file last-version/source/change-log samba-1.9.14alpha20/source/change-log
  26. --- last-version/source/change-log    Wed Sep 20 00:33:10 1995
  27. +++ samba-1.9.14alpha20/source/change-log    Thu Sep 21 20:57:12 1995
  28. @@ -1583,7 +1583,11 @@
  29.      from Ian McEwan <ijm@doc.ic.ac.uk>)
  30.      - fixed "guest only" bug
  31.      - sambatar patches from Ricky
  32. -
  33. +    - printing.c patches from Dirk.DeWachter@rug.ac.be
  34. +    - rewrote become_user()
  35. +    - sunos5 patch from Niels.Baggesen@uni-c.dk
  36. +    - more japanese extensions patches from fujita@ainix.isac.co.jp 
  37. +    - released alpha20
  38.  
  39.  ==========
  40.  todo:
  41. diff -u -r --new-file last-version/source/includes.h samba-1.9.14alpha20/source/includes.h
  42. --- last-version/source/includes.h    Wed Sep 20 01:21:06 1995
  43. +++ samba-1.9.14alpha20/source/includes.h    Thu Sep 21 20:49:47 1995
  44. @@ -233,6 +233,7 @@
  45.  #include <sys/statfs.h>
  46.  #include <sys/statvfs.h>
  47.  #include <sys/filio.h>
  48. +#include <sys/sockio.h>
  49.  #include <netinet/in_systm.h>
  50.  #include <netinet/tcp.h>
  51.  #include <netinet/ip.h>
  52. @@ -827,7 +828,7 @@
  53.  #endif
  54.  
  55.  #ifndef perror
  56. -#define perror(s) printf("%s: %s\n",s,strerror(errno))
  57. +#define perror(m) printf("%s: %s\n",m,strerror(errno))
  58.  #endif
  59.  
  60.  #ifndef MAXHOSTNAMELEN
  61. diff -u -r --new-file last-version/source/ipc.c samba-1.9.14alpha20/source/ipc.c
  62. --- last-version/source/ipc.c    Wed Sep 20 01:26:25 1995
  63. +++ samba-1.9.14alpha20/source/ipc.c    Thu Sep 21 20:49:48 1995
  64. @@ -1227,7 +1227,7 @@
  65.            !become_service(Files[i].cnum,True))
  66.          break;
  67.            
  68. -          if (rename(Files[i].name,name) == 0)
  69. +          if (sys_rename(Files[i].name,name) == 0)
  70.          string_set(&Files[i].name,name);
  71.            break;
  72.          }
  73. diff -u -r --new-file last-version/source/kanji.h samba-1.9.14alpha20/source/kanji.h
  74. --- last-version/source/kanji.h    Fri Sep 15 20:17:44 1995
  75. +++ samba-1.9.14alpha20/source/kanji.h    Thu Sep 21 20:49:48 1995
  76. @@ -33,7 +33,7 @@
  77.  
  78.  /* FOR SHIFT JIS CODE */
  79.  #define is_shift_jis(c) \
  80. -    ((0x80 <= ((unsigned char) (c)) && ((unsigned char) (c)) <= 0x9f) \
  81. +    ((0x81 <= ((unsigned char) (c)) && ((unsigned char) (c)) <= 0x9f) \
  82.       || (0xe0 <= ((unsigned char) (c)) && ((unsigned char) (c)) <= 0xef))
  83.  #define is_shift_jis2(c) \
  84.      (0x40 <= ((unsigned char) (c)) && ((unsigned char) (c)) <= 0xfc \
  85. diff -u -r --new-file last-version/source/printing.c samba-1.9.14alpha20/source/printing.c
  86. --- last-version/source/printing.c    Sat Sep 16 11:45:51 1995
  87. +++ samba-1.9.14alpha20/source/printing.c    Thu Sep 21 20:27:02 1995
  88. @@ -360,7 +360,7 @@
  89.    static int jobid;
  90.    static int jobprio;
  91.    static time_t jobtime;
  92. -  static int jobstat=LPSTAT_OK;
  93. +  static int jobstat=LPQ_QUEUED;
  94.    /* to store minimum priority to print, lpstat command should be invoked
  95.       with -p option first, to work */
  96.    static int base_prio;
  97. @@ -439,9 +439,10 @@
  98.      }
  99.      else {
  100.         jobstat = LPQ_QUEUED;
  101. -       if ((strequal(tok[8],"on")) ||
  102. -       ((strequal(tok[8],"from")) && (strequal(tok[10],"on"))))
  103. -      jobstat = LPQ_PRINTING;
  104. +       if ((count >8) && (((strequal(tok[8],"on")) ||
  105. +               ((strequal(tok[8],"from")) && 
  106. +                ((count > 10)&&(strequal(tok[10],"on")))))))
  107. +     jobstat = LPQ_PRINTING;
  108.      }
  109.      
  110.      header_line_ok=True; /* information is correct */
  111. @@ -658,7 +659,7 @@
  112.        break;
  113.      }
  114.  
  115. -      bzero((char *)(*queue),sizeof(**queue));
  116. +      bzero((char *)&(*queue)[count],sizeof(**queue));
  117.        
  118.        /* parse it */
  119.        if (!parse_lpq_entry(snum,line,&(*queue)[count],status,count==0))
  120. diff -u -r --new-file last-version/source/reply.c samba-1.9.14alpha20/source/reply.c
  121. --- last-version/source/reply.c    Sat Sep 16 12:09:39 1995
  122. +++ samba-1.9.14alpha20/source/reply.c    Thu Sep 21 20:49:48 1995
  123. @@ -2493,7 +2493,7 @@
  124.      strcat(directory,mask);
  125.      if (resolve_wildcards(directory,newname) && 
  126.      can_rename(directory,cnum) && 
  127. -    !rename(directory,newname)) count++;
  128. +    !sys_rename(directory,newname)) count++;
  129.    } else {
  130.      void *dirptr = NULL;
  131.      char *dname;
  132. @@ -2521,7 +2521,7 @@
  133.          if (!can_rename(fname,cnum)) continue;
  134.          strcpy(destname,newname);
  135.          if (resolve_wildcards(fname,destname) && 
  136. -        !rename(fname,destname)) count++;
  137. +        !sys_rename(fname,destname)) count++;
  138.          DEBUG(3,("reply_mv : doing rename on %s -> %s\n",fname,destname));
  139.        }
  140.      CloseDir(dirptr);
  141. diff -u -r --new-file last-version/source/server.c samba-1.9.14alpha20/source/server.c
  142. --- last-version/source/server.c    Tue Sep 19 14:46:56 1995
  143. +++ samba-1.9.14alpha20/source/server.c    Thu Sep 21 20:49:48 1995
  144. @@ -1585,90 +1585,67 @@
  145.  BOOL become_user(int cnum, int uid)
  146.  {
  147.    user_struct *vuser;
  148. -  int snum;
  149. +  int snum,gid;
  150. +  int ngroups;
  151. +  gid_t *groups;
  152.  
  153. -  if (!OPEN_CNUM(cnum))
  154. -    {
  155. -      DEBUG(2,("Connection %d not open\n",cnum));
  156. -      return(False);
  157. -    }
  158. +  if (!OPEN_CNUM(cnum)) {
  159. +    DEBUG(2,("Connection %d not open\n",cnum));
  160. +    return(False);
  161. +  }
  162.  
  163. -  if (done_become_user == uid)
  164. -    {
  165. -      DEBUG(4,("Skipping become_user - already user\n"));
  166. -      return(True);
  167. +  snum = Connections[cnum].service;
  168. +
  169. +  if (lp_security() == SEC_SHARE || (*lp_force_user(snum))) {
  170. +    uid = Connections[cnum].uid;
  171. +    gid = Connections[cnum].gid;
  172. +    groups = Connections[cnum].groups;
  173. +    ngroups = Connections[cnum].ngroups;
  174. +  } else {
  175. +    vuser = get_valid_user_struct(uid);
  176. +    if (!vuser) {
  177. +      DEBUG(2,("Invalid vuid used %d\n",uid));
  178. +      return(False);
  179.      }
  180. +    uid = vuser->uid;
  181. +    if(!*lp_force_group(snum))
  182. +      gid = vuser->gid;
  183. +    else
  184. +      gid = Connections[cnum].gid;
  185. +    groups = vuser->user_groups;
  186. +    ngroups = vuser->user_ngroups;
  187. +  }
  188. +
  189. +  if (done_become_user == uid) {
  190. +    DEBUG(4,("Skipping become_user - already user\n"));
  191. +    return(True);
  192. +  }
  193.  
  194.    if (done_become_user != -1)
  195.      unbecome_user();
  196.  
  197. -  snum = Connections[cnum].service;
  198. -
  199. -  /* Check if the user id given has been validated 
  200. -     If so, become that user, else become the opener
  201. -     of the connection. 
  202. -     *** NOTE *** SHOULD THIS JUST FAIL INSTEAD if get_valid_user_struct
  203. -     returns NULL ?????
  204. -  */
  205. -  if(!(*lp_force_user(snum)) && (vuser = get_valid_user_struct(uid)))
  206. -    {
  207. -      DEBUG(5,("got valid user_struct for uid %d\n", uid));
  208. -      if (initial_uid == 0)
  209. -    {
  210. -    int gid_to_become;
  211. -    if(!*lp_force_group(snum))
  212. -      gid_to_become = vuser->gid;
  213. -    else
  214. -      gid_to_become = Connections[cnum].gid;
  215. -
  216. -    if (!become_gid(gid_to_become))
  217. -      return(False);
  218. -          
  219. -#ifndef NO_SETGROUPS
  220. -    if (!IS_IPC(cnum))
  221. -      {
  222. -      /* groups stuff added by ih/wreu */
  223. -      if (vuser->user_ngroups > 0)
  224. -        if (setgroups(vuser->user_ngroups,(GID_TYPE *)vuser->user_groups)<0)
  225. -          DEBUG(0,("setgroups call failed!\n"));
  226. -      }
  227. -#endif
  228. -          
  229. -    if (!Connections[cnum].admin_user && !become_uid(vuser->uid))
  230. -      return(False);
  231. -    }
  232. -     }
  233. -  else
  234. +  if (initial_uid == 0)
  235.      {
  236. -      uid = Connections[cnum].uid; /* Set this so done_become_user 
  237. -                      is set correctly */
  238. -
  239. -      if (initial_uid == 0)
  240. -        {
  241. -        if (!become_gid(Connections[cnum].gid))
  242. -      return(False);
  243. +      if (!become_gid(gid)) return(False);
  244.  
  245.  #ifndef NO_SETGROUPS      
  246. -    if (!IS_IPC(cnum))
  247. -      {
  248. -        /* groups stuff added by ih/wreu */
  249. -        if (Connections[cnum].ngroups > 0)
  250. -          if (setgroups(Connections[cnum].ngroups,
  251. -                (GID_TYPE *)Connections[cnum].groups)<0)
  252. -            DEBUG(0,("setgroups call failed!\n"));
  253. -      }
  254. +      if (!IS_IPC(cnum)) {
  255. +    /* groups stuff added by ih/wreu */
  256. +    if (ngroups > 0)
  257. +      if (setgroups(ngroups,(GID_TYPE *)groups)<0)
  258. +        DEBUG(0,("setgroups call failed!\n"));
  259. +      }
  260.  #endif
  261.  
  262. -        if (!Connections[cnum].admin_user && !become_uid(Connections[cnum].uid))
  263. -      return(False);
  264. -        }
  265. +      if (!Connections[cnum].admin_user && !become_uid(uid))
  266. +    return(False);
  267.      }
  268.  
  269.    old_umask = umask(0777 & ~(CREATE_MODE(cnum)));
  270.  
  271.    done_become_user = uid;
  272.    
  273. -  DEBUG(5,("become_user now uid=(%d,%d) gid=(%d,%d)\n",
  274. +  DEBUG(5,("become_user uid=(%d,%d) gid=(%d,%d)\n",
  275.         getuid(),geteuid(),getgid(),getegid()));
  276.    
  277.    return(True);
  278. @@ -2148,7 +2125,7 @@
  279.            pstring name;
  280.            fclose(dbf); dbf = NULL;
  281.            sprintf(name,"%s.old",debugf);
  282. -          rename(debugf,name);
  283. +          sys_rename(debugf,name);
  284.            reopen_logs();
  285.          }
  286.      }
  287. diff -u -r --new-file last-version/source/smb.h samba-1.9.14alpha20/source/smb.h
  288. --- last-version/source/smb.h    Fri Sep 15 21:14:23 1995
  289. +++ samba-1.9.14alpha20/source/smb.h    Thu Sep 21 20:58:15 1995
  290. @@ -561,6 +561,7 @@
  291.  };
  292.  
  293.  /* and a few prototypes */
  294. +int sys_rename(char *from, char *to);
  295.  int sys_select(fd_set *fds,struct timeval *tval);
  296.  int sys_unlink(char *fname);
  297.  int sys_open(char *fname,int flags,int mode);
  298. diff -u -r --new-file last-version/source/system.c samba-1.9.14alpha20/source/system.c
  299. --- last-version/source/system.c    Fri Sep 15 21:18:15 1995
  300. +++ samba-1.9.14alpha20/source/system.c    Thu Sep 21 21:01:05 1995
  301. @@ -182,3 +182,20 @@
  302.  {
  303.    return(utime(dos_to_unix(fname,False),times));
  304.  }
  305. +
  306. +/*******************************************************************
  307. +for rename()
  308. +********************************************************************/
  309. +int sys_rename(char *from, char *to)
  310. +{
  311. +#ifdef KANJI
  312. +    pstring zfrom, zto;
  313. +    strcpy (zfrom, dos_to_unix (from, False));
  314. +    strcpy (zto, dos_to_unix (to, False));
  315. +    return rename (zfrom, zto);
  316. +#else 
  317. +    return rename (from, to);
  318. +#endif /* KANJI */
  319. +}
  320. +
  321. +
  322. diff -u -r --new-file last-version/source/trans2.c samba-1.9.14alpha20/source/trans2.c
  323. --- last-version/source/trans2.c    Fri Sep 15 21:21:00 1995
  324. +++ samba-1.9.14alpha20/source/trans2.c    Thu Sep 21 20:49:49 1995
  325. @@ -339,9 +339,7 @@
  326.      }
  327.  
  328.  
  329. -#ifdef KANJI
  330. -  kj_dos_format (fname, True);
  331. -#else
  332. +#ifndef KANJI
  333.    unix2dos_format(fname, True);
  334.  #endif
  335.  
  336. diff -u -r --new-file last-version/source/util.c samba-1.9.14alpha20/source/util.c
  337. --- last-version/source/util.c    Wed Sep 20 01:23:04 1995
  338. +++ samba-1.9.14alpha20/source/util.c    Thu Sep 21 21:05:13 1995
  339. @@ -1051,11 +1051,9 @@
  340.  {
  341.    pstring namecopy;
  342.    string_replace(fname,'\\','/');
  343. -#ifdef KANJI
  344. -  kj_unix_format (fname, True);
  345. -#else
  346. +#ifndef KANJI
  347.    dos2unix_format(fname, True);
  348. -#endif
  349. +#endif /* KANJI */
  350.  
  351.    if (*fname == '/')
  352.      {
  353. @@ -1070,11 +1068,9 @@
  354.  ****************************************************************************/
  355.  void dos_format(char *fname)
  356.  {
  357. -#ifdef KANJI
  358. -  kj_dos_format (fname, True);
  359. -#else
  360. +#ifndef KANJI
  361.    unix2dos_format(fname, True);
  362. -#endif
  363. +#endif /* KANJI */
  364.    string_replace(fname,'/','\\');
  365.  }
  366.  
  367. @@ -3939,12 +3935,24 @@
  368.  char *readdirname(void *p)
  369.  {
  370.    struct DIRECT *ptr;
  371. +  char *dname;
  372.  
  373.    if (!p) return(NULL);
  374.    
  375.    ptr = (struct DIRECT *)readdir(p);
  376.    if (!ptr) return(NULL);
  377.  
  378. +  dname = ptr->d_name;
  379. +
  380. +#ifdef KANJI
  381. +  {
  382. +    static pstring buf;
  383. +    strcpy(buf, dname);
  384. +    unix_to_dos(buf, True);
  385. +    dname = buf;
  386. +  }
  387. +#endif
  388. +
  389.  #ifdef NEXT2
  390.    if (telldir(p) < 0) return(NULL);
  391.  #endif
  392. @@ -3954,17 +3962,17 @@
  393.     of BSD and SYSV headers and libraries */
  394.    {
  395.      static BOOL broken_readdir = False;
  396. -    if (!broken_readdir && !(*(ptr->d_name)) && strequal("..",ptr->d_name-2))
  397. +    if (!broken_readdir && !(*(dname)) && strequal("..",dname-2))
  398.        {
  399.      DEBUG(0,("Your readdir() is broken. You have somehow mixed SYSV and BSD headers and libraries\n"));
  400.      broken_readdir = True;
  401.        }
  402.      if (broken_readdir)
  403. -      return(ptr->d_name-2);
  404. +      return(dname-2);
  405.    }
  406.  #endif
  407.  
  408. -  return(ptr->d_name);
  409. +  return(dname);
  410.  }
  411.  
  412.  
  413. diff -u -r --new-file last-version/source/version.h samba-1.9.14alpha20/source/version.h
  414. --- last-version/source/version.h    Wed Sep 20 01:46:17 1995
  415. +++ samba-1.9.14alpha20/source/version.h    Thu Sep 21 21:06:09 1995
  416. @@ -1 +1 @@
  417. -#define VERSION "1.9.14alpha19"
  418. +#define VERSION "1.9.14alpha20"
  419.